package com.lgx.mall.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lgx.common.basic.dao.GeneralJdbcDao;
import com.lgx.common.exception.DataException;
import com.lgx.common.web.Pagination;
import com.lgx.mall.business.dao.IRechargeInfoDao;
import com.lgx.mall.business.entity.RechargeInfo;
import com.lgx.mall.business.service.IRechargeInfoService;

@Service("rechargeInfoService")
public class RechargeInfoService implements IRechargeInfoService {

	@Autowired
	private IRechargeInfoDao rechargeInfoDao;
	
	public IRechargeInfoDao getRechargeInfoDao() {
		return rechargeInfoDao;
	}

	public void setRechargeInfoDao(IRechargeInfoDao rechargeInfoDao) {
		this.rechargeInfoDao = rechargeInfoDao;
	}
	
	@Autowired
	private GeneralJdbcDao baseDao;
	
	public GeneralJdbcDao getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(GeneralJdbcDao baseDao) {
		this.baseDao = baseDao;
	}

	public RechargeInfo createRechargeInfo(RechargeInfo rechargeInfo) throws DataException {
		return rechargeInfoDao.createRechargeInfo(rechargeInfo);
	}

	public RechargeInfo updateRechargeInfo(RechargeInfo rechargeInfo) throws DataException {
		return rechargeInfoDao.updateRechargeInfo(rechargeInfo);
	}

	public void deleteRechargeInfo(RechargeInfo rechargeInfo) throws DataException {
		rechargeInfoDao.deleteRechargeInfo(rechargeInfo);
	}

	public void deleteRechargeInfo(long id) throws DataException {
		rechargeInfoDao.deleteRechargeInfo(id);
	}

	public RechargeInfo findRechargeInfoById(long id) {
		return rechargeInfoDao.findRechargeInfoById(id);
	}
	
	public Pagination findRechargeInfoPagination(Object[] params, int pageSize, int pageNum){
		return this.rechargeInfoDao.findRechargeInfoPagination(params, pageSize, pageNum);
	}
	
	public void deleteRechargeInfos(String[] ids) {
		
		try {
			this.rechargeInfoDao.deleteRechargeInfos(ids);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public RechargeInfo findRechargeInfoByOrderNo(String orderNo) {
		return this.rechargeInfoDao.findRechargeInfoByOrderNo(orderNo);
	}
}
